package com.bw.wxy.mvp.view.pople.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bw.wxy.R;
import com.bw.wxy.common.GlideUtils;
import com.bw.wxy.mvp.model.entity.RecommendEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class RecommendAdapter extends BaseQuickAdapter<RecommendEntity.Values, BaseViewHolder> {
    public RecommendAdapter( @Nullable List<RecommendEntity.Values> data) {
        super(R.layout.item_video_recommend, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RecommendEntity.Values item) {
        helper.setText(R.id.video_recommend_title_tv,item.news_title);
        helper.setText(R.id.video_recommend_author_tv,item.news_author);
        helper.setText(R.id.video_recommend_time_tv,""+item.news_time);
        ImageView imageView = helper.getView(R.id.video_recommend_cover_img);
        GlideUtils.getInstance().loadMatchImg(item.getMedias().get(0).media_url,imageView);
        helper.addOnClickListener(R.id.video_recommend_play_img);
    }
}

